﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Project_Vital.StringResources;
using Project_Vital.Dao;

namespace Project_Vital
{

    public partial class tabForms : Form
    {
        private void Main_Load(object sender, EventArgs e)
        {
        }

      
        public tabForms()
        {
            InitializeComponent();
            TreeViewLoader treeViewLoader = new TreeViewLoader();
            treeViewLoader.LoadTreeViewControl(mainTreeView, "BaseTreeControl.xml");

            this.Text = FormTitle.SoftwareTitle;




            
        }

        

       

        private void customerToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }

        private void mainTreeView_DoubleClick(object sender, EventArgs e)
        {
            switch (mainTreeView.SelectedNode.Text)
            {
                case "View Customer": ViewCustomer(); break;
                case "Create Customer": CreateCustomer(); break;
                case "Delete Customer": DeleteCustomer(); break;
                case "Edit Customer": EditCustomer(); break;

                case "View Employee": ViewEmployee(); break;
                case "Create Employee": CreateEmployee(); break;
                case "Delete Employee": DeleteEmployee(); break;
                case "Edit Employee": EditEmployee();    break;
                
                // Create Supplier call
                case "Create Supplier": CreateSupplier(); break;

            }
        }




        private void ViewCustomer()
        {
            ViewCustomers frm1 = new ViewCustomers();
            frm1.TopLevel = false;
            frm1.Dock = DockStyle.Fill;
            this.splitContainer1.Panel2.Controls.Add(frm1);
            frm1.Show(); 
        }

        private void CreateCustomer()
        {
           CustomerDetails frm = new CustomerDetails();
           frm.TopLevel = false;
          // frm.maskedTextBox1 = "Testing";
           frm.Dock = DockStyle.Fill;
           this.splitContainer1.Panel2.Controls.Add(frm);
           frm.Show();
        }
        private void DeleteCustomer()
        {

        }
        private void EditCustomer()
        {

        }
        private void ViewEmployee()
        {

        }
        private void CreateEmployee()
        {

        }
        private void DeleteEmployee()
        {

        }
        private void EditEmployee()
        {

        }

        // show Supplier form
        private void CreateSupplier()
        {
            SupplierDetails frm = new SupplierDetails();
            frm.TopLevel = false;
            // frm.maskedTextBox1 = "Testing";
            frm.Dock = DockStyle.Fill;
            this.splitContainer1.Panel2.Controls.Add(frm);
            frm.Show();
        }


    }
}
